
from redis import StrictRedis
class Config(object):
    DEBUG = None
    #设置秘钥
    SECRET_KEY = 'Y/K54ZFPkyAvtF7e7x1WpCWoFrf3i7FBxBPqptz+lcqu1hCIL51tOA=='
    #配置数据库的连接和动态追踪
    SQLALCHEMY_DATABASE_URI = 'mysql://root:woaini2008@localhost/flask_project2'
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    # 定义redis的主机和port端口号
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379
    # 配置状态保持存储的session信息
    SESSION_TYPE = 'redis'
    # 配置session的签名
    SESSION_SIGNER = True
    # 构造redis的实例
    SESSION_REDIS = StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
    # 配置session的过期时间 一天为86400s
    PERMANENT_SESSION_LIFETIME = 86400

#开发模式下的配置信息
class developmentConfig(Config):
    DEBUG = True
#生产模式下的配置信息
class productionConfig(Config):
    DEBUG = False

config = {
    'development': developmentConfig,
    'production': productionConfig
}

